#include <stdio.h>
#include <ctype.h>
#include <assert.h>
//support sign and decimal
int atoi(char v[])
{
  int sign = 1;
  int i = 0;//index of v[]
  int sum =0;
  if(v[0] == '-'){
    sign = -1;
    i++;
  }
  else if(v[0] == '+') {
    sign = 1;
    i++;
  }
  else {
    sign = 1;
    assert(isdigit(v[0]));
  }

  for(;v[i] != '\0';i++){
    assert(isdigit(v[i]));
    sum = sum*10 + v[i]-'0';
  }

  sum = sign*sum;
  return sum;
} 

int main(int argc, char *argv[])
{
  int num;
  assert(argc == 2);

  num = atoi(argv[1]);
  printf("%d\n",num);
  return 0;
}
